home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / csfilesc / filesamp.frm < prev    next >
Text File  |  1998-10-08  |  5KB  |  159 lines

  1. VERSION 5.00
  2. Object = "{FDB5C7D6-5D15-11D1-A5CA-682504C10E27}#2.1#0"; "CSFILE.OCX"
  3. Begin VB.Form frmFileToolSample 
  4.    Caption         =   "FileTool Sample"
  5.    ClientHeight    =   4590
  6.    ClientLeft      =   5490
  7.    ClientTop       =   3390
  8.    ClientWidth     =   4710
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   4590
  11.    ScaleWidth      =   4710
  12.    Begin VB.Frame Frame3 
  13.       Caption         =   "SaveFile Dialog"
  14.       Height          =   855
  15.       Left            =   180
  16.       TabIndex        =   9
  17.       Top             =   3300
  18.       Width           =   4395
  19.       Begin VB.TextBox txtSave 
  20.          Height          =   315
  21.          Left            =   1020
  22.          TabIndex        =   11
  23.          Top             =   300
  24.          Width           =   3255
  25.       End
  26.       Begin VB.CommandButton cmdSave 
  27.          Caption         =   "Save"
  28.          Height          =   315
  29.          Left            =   120
  30.          TabIndex        =   10
  31.          Top             =   300
  32.          Width           =   795
  33.       End
  34.    End
  35.    Begin VB.Frame Frame2 
  36.       Caption         =   "BrowseForFile Dialog"
  37.       Height          =   855
  38.       Left            =   120
  39.       TabIndex        =   6
  40.       Top             =   300
  41.       Width           =   4455
  42.       Begin VB.TextBox txtSelectFile 
  43.          Height          =   315
  44.          Left            =   120
  45.          TabIndex        =   8
  46.          Top             =   300
  47.          Width           =   3735
  48.       End
  49.       Begin VB.CommandButton cmdSelectFile 
  50.          Caption         =   "..."
  51.          BeginProperty Font 
  52.             Name            =   "MS Sans Serif"
  53.             Size            =   8.25
  54.             Charset         =   0
  55.             Weight          =   700
  56.             Underline       =   0   'False
  57.             Italic          =   0   'False
  58.             Strikethrough   =   0   'False
  59.          EndProperty
  60.          Height          =   315
  61.          Left            =   3900
  62.          TabIndex        =   7
  63.          Top             =   300
  64.          Width           =   375
  65.       End
  66.    End
  67.    Begin VB.Frame Frame1 
  68.       Caption         =   "BrowseForFolder Dialog and SearchFile"
  69.       Height          =   1695
  70.       Left            =   120
  71.       TabIndex        =   0
  72.       Top             =   1380
  73.       Width           =   4455
  74.       Begin VB.CommandButton cmdSelectPath 
  75.          Caption         =   "..."
  76.          BeginProperty Font 
  77.             Name            =   "MS Sans Serif"
  78.             Size            =   8.25
  79.             Charset         =   0
  80.             Weight          =   700
  81.             Underline       =   0   'False
  82.             Italic          =   0   'False
  83.             Strikethrough   =   0   'False
  84.          EndProperty
  85.          Height          =   315
  86.          Left            =   3900
  87.          TabIndex        =   4
  88.          Top             =   300
  89.          Width           =   375
  90.       End
  91.       Begin VB.TextBox txtSelectPath 
  92.          Height          =   315
  93.          Left            =   120
  94.          TabIndex        =   3
  95.          Top             =   300
  96.          Width           =   3735
  97.       End
  98.       Begin VB.TextBox txtSearchFile 
  99.          Height          =   315
  100.          Left            =   120
  101.          TabIndex        =   2
  102.          Top             =   1020
  103.          Width           =   3315
  104.       End
  105.       Begin VB.CommandButton cmdSearchFile 
  106.          Caption         =   "Search"
  107.          Height          =   315
  108.          Left            =   3480
  109.          TabIndex        =   1
  110.          Top             =   1020
  111.          Width           =   795
  112.       End
  113.       Begin VB.Label Label3 
  114.          Caption         =   "Enter a file to find and click Search"
  115.          Height          =   255
  116.          Left            =   180
  117.          TabIndex        =   5
  118.          Top             =   780
  119.          Width           =   3315
  120.       End
  121.    End
  122.    Begin CSFile.FileTool FileTool1 
  123.       Left            =   240
  124.       Top             =   4200
  125.       _ExtentX        =   635
  126.       _ExtentY        =   582
  127.    End
  128. End
  129. Attribute VB_Name = "frmFileToolSample"
  130. Attribute VB_GlobalNameSpace = False
  131. Attribute VB_Creatable = False
  132. Attribute VB_PredeclaredId = True
  133. Attribute VB_Exposed = False
  134. Option Explicit
  135. Private Sub cmdSearchFile_Click()
  136. Dim p As String
  137. Dim f As String
  138. Dim b As String
  139. p = txtSelectPath.Text & IIf(Right(txtSelectPath.Text, 1) = "\", "", "\")
  140. f = txtSearchFile.Text
  141. b = p & f
  142.     If FileTool1.Exists(b) = False Then
  143.         MsgBox "File not found", , "File not found"
  144.     Else
  145.         MsgBox b, , "File exists"
  146.     End If
  147. End Sub
  148. Private Sub cmdSelectFile_Click()
  149.     txtSelectFile = FileTool1.SelectFile
  150. End Sub
  151. Private Sub cmdSelectPath_Click()
  152.     txtSelectPath = FileTool1.SelectPath
  153. End Sub
  154.  
  155. Private Sub CmdSave_Click()
  156. txtSave = FileTool1.SelectSave
  157. End Sub
  158.  
  159.